This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
There are a couple of different ways to do this. A good programmer will anticipate future changes and requirements (based on his/ner experiences in the past), and write code based on that.
So from what you describe I will assume that those "few hundred records" (you probably mean documents, as Domino is a document centric NoSQL database) eventually will be many thousands...
1) Create a field on the form(s) used for the documents. Call it "LastSaved" for example.
Put code in the forms QuerySave event that will store current date and time in that field.
2) Create a new hidden view, call it for example "(LastSaved)". Set the select criteria of the view to include documents where "LastSaved" is not blank/empty.
The first column should be the LastSaved field, sorted descending. Column 2 could be the owner of the document (whatever field/way you identify that).
3) Now you write a scheduled agent that you run say at 3am every day. The agent will do the following:
* Create a new NotesDateTime object with todays date, then use the AdjustDay method to set it back 14 days.
* Create a NotesView object from the view "(LastSaved)" in the NotesDatabase.
* Get a NotesViewEntryCollection from the NotesView (use the AllEntries property).
* Use the GetFirstEntry/GetNextEntry methods of the NotesViewEntryCollection to loop through the collection, getting one NotesViewEntry at a time.
* For each entry, use the ColumnValues property to get the value in the first column (the date). Use Cdat to convert it into a date, then use (for example) the LSLocalTime property of the NotesDateTime object to get the date/time 2 weeks ago. Compare the two values:
If the value from the entry is less than the one from the DateTime object, the entry was last ipdated more than two weeks ago, and you can send the email notification.
If the value is equal to or larger, you have processed all entries that are older, and you can exit the loop.
This should be the fastest way to process the documents, you don't have to process all documents, just the ones that actually are older than 2 weeks.
It sounds like you are new to Lotus Notes development, do you by any chance come from a relational database background, since you talk about "records"? You may want to learn the proper terms in Notes, that makes it much easier to help you.
Feedback response number WEBB9SK7RQ created by ~Dan Kikiterobu on 01/08/2015